<!--#layout("/common/layout.html",{"jsBase":"/js/spread/share/"}){ -->
<div class="layui-row">
    <form id="searchForm" class="layui-form layui-form-pane">
        <br>
        <input type="hidden" name="channel" value="${channel}" >
        <div class="layui-row">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">推广人</label>
                    <div class="layui-input-inline">
                        <input type="text" name="phone" autocomplete="off" class="layui-input" >
                    </div>
                    <label class="layui-form-label">推广码</label>
                    <div class="layui-input-inline">
                        <input type="text" name="promoteCode" autocomplete="off" class="layui-input">
                    </div>

                    <label class="layui-form-label">所属渠道</label>
                    <div class="layui-input-inline">
                        <layui:simpleDataSelect name="channelName"  data="${channels}"
                                                attrId="channelName" attrName="channelName" laySearch="true" layFilter="colFilter"/>
                    </div>

                </div>
                <div class="layui-inline show-div">

                    <label class="layui-form-label">渠道代码</label>
                    <div class="layui-input-inline">
                        <input type="text" name="channelCode" autocomplete="off" class="layui-input" id="channelCode">
                    </div>

                    <label class="layui-form-label">销售额</label>
                    <div class="layui-input-inline" style="width: 84px;">
                        <input type="text" name="totalMoneyStart" autocomplete="off" class="layui-input" oninput="value=value.replace(/[^\d]/g,'')">
                    </div>
                    <div class="layui-input-inline" style="width: 4px;">
                        -
                    </div>
                    <div class="layui-input-inline" style="width: 84px;">
                        <input type="text" name="totalMoneyEnd" autocomplete="off" class="layui-input" oninput="value=value.replace(/[^\d]/g,'')">
                    </div>

                    <label class="layui-form-label">佣金总额</label>
                    <div class="layui-input-inline" style="width: 84px;">
                        <input type="text" name="commissionMoneyStart" autocomplete="off" class="layui-input" oninput="value=value.replace(/[^\d]/g,'')">
                    </div>
                    <div class="layui-input-inline" style="width: 4px;">
                        -
                    </div>
                    <div class="layui-input-inline" style="width: 84px;">
                        <input type="text" name="commissionMoneyEnd" autocomplete="off" class="layui-input" oninput="value=value.replace(/[^\d]/g,'')">
                    </div>

                </div>
                <div class="layui-inline show-div">

                    <label class="layui-form-label">提现金额</label>
                    <div class="layui-input-inline" style="width: 84px;">
                        <input type="text" name="withdrawAmountStart" autocomplete="off" class="layui-input" oninput="value=value.replace(/[^\d]/g,'')">
                    </div>
                    <div class="layui-input-inline" style="width: 4px;">
                        -
                    </div>
                    <div class="layui-input-inline" style="width: 84px;">
                        <input type="text" name="withdrawAmountEnd" autocomplete="off" class="layui-input" oninput="value=value.replace(/[^\d]/g,'')">
                    </div>


                    <label class="layui-form-label">订单数</label>
                    <div class="layui-input-inline" style="width: 84px;">
                        <input type="text" name="totalStart" autocomplete="off" class="layui-input" oninput="value=value.replace(/[^\d]/g,'')">
                    </div>
                    <div class="layui-input-inline" style="width: 4px;">
                        -
                    </div>
                    <div class="layui-input-inline" style="width: 84px;">
                        <input type="text" name="totalEnd" autocomplete="off" class="layui-input" oninput="value=value.replace(/[^\d]/g,'')">
                    </div>


                    <label class="layui-form-label">提现时间</label>
                    <div class="layui-input-inline">
                        <div class="date-range-pick">
                            <input type="text" name="withdrawTimeQuery" autocomplete="off" class="layui-input" >
                        </div>
                    </div>
                </div>

                <div class="layui-inline">
                    <button class="layui-btn layui-btn-normal" type="button" id="searchFormSearch">搜索</button>
                    <button class="layui-btn" type="button" id="clear">清空</button>
                    <button class="layui-btn layui-btn-primary" type="button" id="show">展开</button>
                </div>

            </div>
        </div>
    </form>
</div>

<div class="layui-btn-group">
    <!--<layui:accessButton function="promote.promotePerson.add" action="add">增加</layui:accessButton>-->
<!--    <layui:accessButton function="promote.promotePerson.edit" action="edit">编辑</layui:accessButton>-->
    <!--<layui:accessButton function="promote.promotePerson.del" action="del">删除</layui:accessButton>-->
</div>

<table id="promotePersonTable" lay-filter="promotePersonTable"></table>
<!--#} -->
<script>
    layui.use(['index'], function () {
        var index = layui.index;
        var flag = false;
        var channel = "${channel}";
        if(channel){
            $("#channelCode").attr("readonly","readonly");
        }
        $(".show-div").hide();
        $("#clear").hide();
        $("#show").click(function(){
            if(flag){
                flag = false;
                $(".show-div").hide();
                $("#clear").hide();
                $("#show").text('展开');
            }else{
                flag = true;
                $("#searchForm")[0].reset();
                $(".show-div").show();
                $("#clear").show();
                $("#show").text('收起');
            }
        });
        $("#clear").click(function(){
            $("#searchForm")[0].reset();
        });
        index.init();
    });

</script>
